#include <vtkForceDirectedLayoutStrategy.h>
#include <vtkGraphLayoutView.h>
#include <vtkMutableUndirectedGraph.h>
#include <vtkNamedColors.h>
#include <vtkNew.h>
#include <vtkRenderWindow.h>
#include <vtkRenderWindowInteractor.h>
#include <vtkRenderer.h>

#include <vtkArcSource.h>
#include <vtkPolyDataMapper.h>
#include "vtkPolygon.h"
#include "vtkRegularPolygonSource.h"
#include "vtkEllipseArcSource.h"
#include "vtkProperty.h"

#include "vtkBezierCurve.h"

int main(int, char*[])
{
    vtkNew<vtkNamedColors> colors;


    vtkNew<vtkRenderer> renderer;
    vtkNew<vtkRenderWindow> renderWindow;
    renderWindow->SetWindowName("RegularPolygonSource");
    renderWindow->AddRenderer(renderer);
    vtkNew<vtkRenderWindowInteractor> renderWindowInteractor;
    renderWindowInteractor->SetRenderWindow(renderWindow);



    // Setup four tubeFilter2
    vtkNew<vtkPoints> points;
    points->InsertNextPoint(0.0, 0.0, 0.0);
    points->InsertNextPoint(1.0, 0.0, 0.0);
    points->InsertNextPoint(1.0, 1.0, 0.0);
    points->InsertNextPoint(0.0, 1.0, 0.0);

    // Create the polygon
    vtkNew<vtkPolygon> polygon;
    polygon->GetPointIds()->SetNumberOfIds(4); // make a quad
    polygon->GetPointIds()->SetId(0, 0);
    polygon->GetPointIds()->SetId(1, 1);
    polygon->GetPointIds()->SetId(2, 2);
    polygon->GetPointIds()->SetId(3, 3);


    vtkNew<vtkBezierCurve> curve;
//    curve->SetRationalWeightsFromPointData()


    // Add the polygon to a list of polygons
    vtkNew<vtkCellArray> polygons;
    polygons->InsertNextCell(polygon);
//    polygons->InsertNextCell(curve);

    // Create a PolyData
    vtkNew<vtkPolyData> polygonPolyData;
    polygonPolyData->SetPoints(points);
    polygonPolyData->SetPolys(polygons);

    // Create a mapper and actor
    vtkNew<vtkPolyDataMapper> mapper;
    mapper->SetInputData(polygonPolyData);

    vtkNew<vtkActor> actor;
    actor->SetMapper(mapper);
    actor->GetProperty()->EdgeVisibilityOn();

    vtkColor3d actorColor = colors->GetColor3d("AliceBlue");
    vtkColor3d EdgeColour = colors->GetColor3d("SteelBlue");

    actor->GetProperty()->SetColor(actorColor.GetData());
    actor->GetProperty()->SetEdgeColor(EdgeColour.GetData());




//    renderer->AddActor(actor);
    renderer->SetBackground(colors->GetColor3d("Red").GetData());

    renderWindow->Render();
    renderWindowInteractor->Start();

    return EXIT_SUCCESS;
}